﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using System.Web.Configuration;

namespace eproject_BusTicketOnline.BusAdminis
{
    public partial class RouteInformation : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            SqlConnection con = new SqlConnection(WebConfigurationManager.ConnectionStrings["ApplicationServices"].ToString());
            con.Open();
            SqlDataAdapter da = new SqlDataAdapter("SELECT     dbo.BusList.BusCategory, dbo.BusList.DeparturePlace, dbo.BusList.ArrivePlace,CONVERT(varchar(20),[StartDate],103) as StartDate, dbo.BusList.Time, CONVERT(varchar(20),[EndDate],103) as EndDate, dbo.BusList.Price, dbo.TotalSeat.Seat AS [Seat has been booked], dbo.BusList.TotalNumberOfSeats FROM dbo.TotalSeat INNER JOIN dbo.BusList ON dbo.TotalSeat.BusListId = dbo.BusList.BusListId", con);
            DataSet ds = new DataSet();
            da.Fill(ds);
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }
    }
}